<?php
class ui_reader_action_edit extends ui {
	/**
	 *
	 * @param object $S
	 * @param array $param = array (
	 * 		id
	 * 		title				// encodeURIComponent POST的Magic Quotes
	 * 		content			// encodeURIComponent POST的Magic Quotes
	 * )
	 */
	public function __construct($S, $param) {
		parent::__construct();
		
		if ($this->uid and $param['id'] and $param['title'] and $param['content']) {
			// 去掉Magic Quote加上的反斜杠， 再把encodeURIComponent的字符串反转回来
			$param['title']		= stripslashes($param['title']);
			$param['content'] 	= stripslashes($param['content']);

			$data_save_article = new data_save_article();
			$result = $data_save_article->edit($this->uid, $param['id'], $param['title'], $param['content']);
			if ($result) $S->assign('data', 'true');
		} else return false;
	}
}
?>